﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Improve157
{
    public class Chapter_06
    {
        public void Method1()
        {
            List<int> _List = new List<int>() { 1, 2, 3, 4, 5, 6 };

            var query = from p in _List select p;

            var queryParallel = from p in _List.AsParallel().AsOrdered() select p;
        }

        public void Method2()
        {
            Task t = new Task(()=> 
            {
                throw new Exception("并行中，未知异常！");
            });
            t.Start();
            Task tEnd = t.ContinueWith((task)=>
            {

            },TaskContinuationOptions.OnlyOnFaulted);
        }
        public void Test()
        {
            System.Diagnostics.Stopwatch watch = new Stopwatch();
            watch.Start();

            Test1("",aa:"bb");
        }


        public void Test1( string c, string a = "abc",string aa ="bbb")
        {

        }

    }
}
